/* 审计日志页面样式 */
.audit-log-page {
  padding: 20px;
  background-color: #f5f7fa;
  min-height: 100vh;
}

/* 页面头部样式 */
.page-header {
  margin-bottom: 24px;
  position: relative;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 12px;
}

/* 加载状态 */
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 400px;
  font-size: 16px;
  color: #6b7280;
}

/* 筛选区域样式 */
.filter-section {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 24px;
}

.filter-form {
  width: 100%;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  align-items: flex-end;
}

.filter-row:last-child {
  margin-bottom: 0;
}

.filter-item {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 150px;
}

.filter-item label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

.filter-input,
.filter-select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
  width: 100%;
}

.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.filter-actions {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.btn-search,
.btn-clear,
.btn-export {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-search {
  background-color: #4f46e5;
  color: white;
}

.btn-search:hover {
  background-color: #4338ca;
  transform: translateY(-1px);
}

.btn-clear {
  background-color: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

.btn-clear:hover {
  background-color: #e5e7eb;
}

.btn-export {
  background-color: #10b981;
  color: white;
}

.btn-export:hover {
  background-color: #059669;
  transform: translateY(-1px);
}

/* 日志容器样式 */
.logs-container {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 24px;
}

.logs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.logs-header h2 {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.log-stats {
  font-size: 14px;
  color: #6b7280;
}

/* 日志表格样式 */
.logs-table-container {
  overflow-x: auto;
  margin-bottom: 20px;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.logs-table th,
.logs-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.logs-table th {
  background-color: #f9fafb;
  font-weight: 600;
  color: #374151;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logs-table td {
  color: #374151;
}

.logs-table tr:hover {
  background-color: #f9fafb;
}

.no-data {
  text-align: center;
  padding: 40px;
  color: #6b7280;
  font-style: italic;
}

/* 状态标签样式 */
.status-tag {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.status-success {
  background-color: #dcfce7;
  color: #15803d;
}

.status-failed {
  background-color: #fee2e2;
  color: #b91c1c;
}

.status-warning {
  background-color: #fef3c7;
  color: #b45309;
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
}

.page-info {
  font-size: 14px;
  color: #6b7280;
}

.page-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-size-select {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background-color: white;
  cursor: pointer;
}

.page-btn {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background-color: white;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  background-color: #f3f4f6;
}

.page-btn.active {
  background-color: #4f46e5;
  color: white;
  border-color: #4f46e5;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-numbers {
  display: flex;
  gap: 4px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .filter-row {
    flex-direction: column;
    gap: 12px;
  }
  
  .filter-item {
    min-width: 100%;
  }
  
  .filter-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .pagination {
    flex-direction: column;
    align-items: stretch;
  }
  
  .page-controls {
    justify-content: center;
  }
  
  .page-info {
    text-align: center;
  }
}

@media (max-width: 768px) {
  .audit-log-page {
    padding: 12px;
  }
  
  .filter-section,
  .logs-container {
    padding: 16px;
  }
  
  .logs-table {
    font-size: 12px;
  }
  
  .logs-table th,
  .logs-table td {
    padding: 8px;
  }
  
  .filter-actions {
    flex-direction: column;
  }
  
  .btn-search,
  .btn-clear,
  .btn-export {
    width: 100%;
  }
  
  .page-controls {
    flex-direction: column;
  }
  
  .page-numbers {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .page-header h1 {
    font-size: 20px;
  }
  
  .logs-header h2 {
    font-size: 16px;
  }
  
  .filter-section,
  .logs-container {
    padding: 12px;
  }
}

/* 打印样式 */
@media print {
  .audit-log-page {
    padding: 0;
    background-color: white;
  }
  
  .filter-section,
  .pagination,
  .page-header .breadcrumb {
    display: none;
  }
  
  .logs-container {
    box-shadow: none;
    padding: 0;
  }
  
  .logs-table {
    font-size: 12px;
  }
  
  .logs-table th,
  .logs-table td {
    padding: 6px;
    border-bottom: 1px solid #ddd;
  }
  
  .status-tag {
    background-color: transparent !important;
    color: inherit !important;
    border: 1px solid #ddd;
  }
}

/* 滚动条样式 */
.logs-table-container::-webkit-scrollbar {
  height: 8px;
}

.logs-table-container::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.logs-table-container::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.logs-table-container::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-section,
.logs-container {
  animation: fadeIn 0.3s ease-out;
}

/* 辅助样式 */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

@media (max-width: 1200px) {
  .truncate {
    max-width: 150px;
  }
}

@media (max-width: 768px) {
  .truncate {
    max-width: 100px;
  }
}